﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Printing;
using System.Windows.Forms;


namespace JoyeriaProject
{
    class PrintManager
    {
        PrintDocument prtDoc;
        PrintDialog prtDialog;

        //public PrintManager()
        //{
        //    prtDialog = new PrintDialog();
        //    prtDoc = new PrintDocument();

        //    prtDoc.DocumentName = "DETALLE-CLIENTE";
        //    prtDialog.Document = prtDoc;

        //    prtDoc.PrintPage += new PrintPageEventHandler(this.Print_Page);


        //    prtDialog.AllowSelection = true;
        //    prtDialog.AllowSomePages = true;
            
        //    if (prtDialog.ShowDialog() == DialogResult.OK)
        //        prtDoc.Print();
        //}

        //public void Print_Page(object sender, PrintPageEventHandler ev)
        //{
        //    float linesPerPage = 0;
        //    float yPos = 0;
        //    int count = 0;
        //    float leftMargin = ev.MarginBounds.Left;
        //    float topMargin = ev.MarginBounds.Top;
        //    string line = null;

        //    // Calculate the number of lines per page.
        //    linesPerPage = ev.MarginBounds.Height /
        //       printFont.GetHeight(ev.Graphics);

        //    // Print each line of the file. 
        //    while (count < linesPerPage &&
        //       ((line = streamToPrint.ReadLine()) != null))////LINEAS LEIDAS
        //    {
        //        yPos = topMargin + (count *
        //           printFont.GetHeight(ev.Graphics));
        //        ev.Graphics.DrawString(line, printFont, Brushes.Black,
        //           leftMargin, yPos, new StringFormat());
        //        count++;
        //    }

        //    // If more lines exist, print another page. 
        //    if (line != null)
        //        ev.HasMorePages = true;
        //    else
        //        ev.HasMorePages = false;

        //}

        

    }
}
